package com.aaa.common.util;


/**
 * @ fileName:BaseController
 * @ description:
 * @ author:zhz
 * @ createTime:2023/5/4 9:05
 * @ version:1.0.0
 */
public class BaseController {

    /**
     * 封装成功方法
     * @param t
     * @param <T>
     * @return
     */
    public <T> Result  success(T t){
        return new Result(ResultStatus.SUCCESS.getReturnCode(),ResultStatus.SUCCESS.getReturnMsg(),
                t);
    }


    /**
     * 封装失败方法
     * @param t
     * @param <T>
     * @return
     */
    public <T> Result  error(T t){
        return new Result(ResultStatus.ERROR.getReturnCode(),ResultStatus.ERROR.getReturnMsg(),
                t);
    }
}
